/**
 * merge level=29
 */

Ext.define('Jfok.report.chart.NumericCombo', {
			extend : 'Jfok.lib.BoxSelect',
			alias : 'widget.reportnumericcombo',

			forceSelection : true,
			// 选中的值就在list中清除掉了
			filterPickList : true,
			editable : false,
			allowBlank : false,
			triggerAction : 'all',
			displayField : 'tf_title',
			valueField : 'tf_fieldName',
			queryMode : 'local',
			stacked : true,
			delimiter : ',',
			initComponent : function() {

				var data = [];
				if (this.grid.isGrouped)
					data.push({
								tf_fieldName : '_count_',
								tf_title : '记录数'
							})
				Ext.Array.forEach(this.grid.groupAndFields, function(fgroup) {
							Ext.Array.forEach(fgroup.fields, function(field) {
										if (field.fieldType == 'Double'
												|| field.fieldType == 'Integer'
												|| field.fieldType == 'Percent'
												|| field.fieldType == 'Float') // tf_isChartCategory
											data.push({
														tf_fieldName : field.dataIndex,
														tf_title : field.text.replace(
																new RegExp('--', 'gm'), '')
													})
									});
						});

				this.store = Ext.create('Ext.data.Store', {
							fields : ['tf_fieldName', 'tf_title'],
							data : data
						});
				if (data.length > 0)
					this.value = data[0].tf_fieldName;
				this.callParent(arguments)
			}

		})